//
//  SuperviseTaskIssueDetailVC.swift
//  SBSafetyApp
//
//  Created by Lina on 2023/1/9.
//
// 【首页-检查监督】检查任务-问题详情

import Foundation
import UIKit

class SuperviseTaskIssueDetailVC: SubLevelViewController {
    
    let taskV = SuperviseTaskIssueDetailView()

    var datas: [SpRwbgtzModal?] = []
    
    var id: Int64!
    
    init(id: Int64!) {
        super.init(nibName: nil, bundle: nil)
        self.id = id
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        title = "问题详情"
        view.backgroundColor = .bg
        setupUI()
        reloadData()
        
    }
    
    func reloadData() {
        API.getJcjdRwbgtzxq(withParam: SpDetailParam(id: id)) { responseModel in
            DispatchQueue.main.async {
                self.taskV.reload(withModal: responseModel.model)
            }
        }
    }
    
    // MARK: - Setup
    
    func setupUI() {
        view.addSubview(taskV)
        taskV.snp.makeConstraints { make in
            make.top.equalTo(view.safeAreaLayoutGuide.snp.top).offset(10)
            make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom)
            make.left.right.equalToSuperview()
        }
    }
}
